package com.ppg.basic.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JdkDynamicProxyHandler implements InvocationHandler {

    private Object subject;


    public JdkDynamicProxyHandler(Object subject) {
        this.subject = subject;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("before ....");


        Object ret = method.invoke(subject, args);

        System.out.println("after ....");

        return ret;
    }
}
